<?php

$pluginName = 'htmlform';
class uploadPlugins_htmlform extends BaseUpload
{
	public function __construct()
	{
		parent::__construct();
	}
	
	public function XHTMLForm()
	{
		return <<<HTML
<h3>You can use this form to upload a file</h3>
<form  enctype="multipart/form-data" action="add.php" method="post">
	<div>
		<input type="file" name="file" />
		<input type="hidden" name="plugin" value="htmlform" />
		<input type="submit" name="submit" value="upload" />
	</div>
</form>
HTML;
	}
	
	public function process()
	{
		if(isset($_FILES['file']['tmp_name']))
		{
			$this->addUploadedFile(new File($_FILES['file']['tmp_name'], $_FILES['file']['name']));
		}
		else
		{
			throw new Exception('No file have been uploaded');
		}
		return parent::process();
	}
	
	public function unactivateMetadataPlugins()
	{
		return array();//'metadataPlugins_name');
	}
}
